﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace oopPrijectDraft
{
    public class Storage:IEncodable
    {
        private List<Merchandise> merchandiseList;
        public Storage(List<Merchandise> merchandise)
        {
            merchandiseList = merchandise;
        }
        internal List<Merchandise> MerchandiseList
        {
            get { return merchandiseList; }
        }
        void display()
        {
            throw new NotImplementedException();
        }
        public bool RemoveMerchandiese(Merchandise itemToBeRemoved)
        {
            throw new NotImplementedException();
        }
        void AddElementInStorage(Merchandise itemToBeAdded)
        {
            throw new NotImplementedException();
        }
        public   void Encode(StreamWriter writer)
        {
            writer.WriteLine(merchandiseList.Count);
            for (int i = 0; i < merchandiseList.Count; i++)
            {
                switch (merchandiseList[i].GetType().Name)
                {
                    case "oopPrijectDraft.DesktopComputer": writer.WriteLine("1"); break; 
                    default:
                        break;
                }
                merchandiseList[i].Encode(writer);
            }
        }
    }
}
